//what is an object

console.log(calculateSum);//
//what are different types of values
//Number, String, Array, Boolean, Regexp, Date, null, undefined, Object

//function

//functions

//console.log(boundary);//undefined

function sum(a,b){
    //a = 10, b -- undefined
    return a + b;//10 + undefined
    //10 + Number(undefined)
    // 10 + NaN --NaN
}

sum(1,4);// 5

console.log(sum(10));//

sum(100,200,300,400,500,600);//
//arr[0];//
//arr -- undefined
var arr = [1,2,3,4,5];
arr[0];//1
arr[1];//2
arr[5];//undefined
var total = 100;
console.log(calculateSum(10,20,30,40,50));//150
//push,pop,shift,unshift
//function declaration
//calculateSum = function
function calculateSum(a,b){
    var output = 0;
    arguments;//object, array like object
    //arguments[0]--10
    //a - 10
    //b --20
    for(var i = 0; i < arguments.length; i++){
        output += arguments[i];
    }
    return output;
}



//console.log(calculateSum(10,20,30,40,50));//150


//functions are first class objects


var boundary = [20,30,40,50,60];
//console.log(boundary);//
//finalSum(10,20);//error
//undefined is not a function
console.log(finalSum);//undefined
var finalSum = function (a,b){
    return a + b;
}
finalSum(3,4);//7

//sum();//calling a function
//sum(10,20)
//function expression
